﻿Imports System.Data.OleDb
Public Class newTag
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btn_saveTag_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_saveTag.Click

        Dim OleDbConn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
        OleDbConn.Open()
        Dim sqlString As String = "INSERT into Tags (TagName) VALUES (@f1)"
        Dim cm As OleDb.OleDbCommand = New OleDb.OleDbCommand(sqlString, OleDbConn)
        cm.Parameters.AddWithValue("@f1", tb_newTag.Text)
        cm.CommandType = CommandType.Text
        cm.ExecuteNonQuery()
        OleDbConn.Close()
        cm.Dispose()
        OleDbConn.Dispose()
    End Sub
End Class